//
//  NSObject+HACSwizzling.h
//  HACRouter
//
//  Created by Chengjie on 2019/5/23.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

/**
 方法交换实现-对象方法交换

 @param cls_ OC类对象
 @param origSel_ 被交换SEL
 @param swizzledSel_ 目标SEL
 */
OBJC_EXPORT void hac_swizzleInstanceMethod(Class cls_, SEL origSel_, SEL swizzledSel_);

/**
 方法交换实现-类方法交换
 
 @param cls_ OC类对象
 @param origSel_ 被交换SEL
 @param swizzledSel_ 目标SEL
 */
OBJC_EXPORT void hac_swizzleClassMethod(Class cls_, SEL origSel_, SEL swizzledSel_);

/**
 返回一个OC类

 @param prefix_ 前缀
 @param suffix_ 后缀
 @return 返回一个类对象
 */
OBJC_EXPORT Class hac_getClass(NSString *prefix_, NSString *suffix_);
OBJC_EXPORT Class hac_getMetaClass(NSString *prefix_, NSString *suffix_);


@interface NSObject (HACSwizzling)

/**
 等价 void hac_swizzleInstanceMethod(Class cls_, SEL origSel_, SEL swizzledSel_)
 */
+ (void)hac_swizzleInstanceMethodWithClass:(Class)cls_ originalMethod:(SEL)origSel_ swizzledMethod:(SEL)swizzledSel_;

/**
 等价 void hac_swizzleClassMethod(Class cls_, SEL origSel_, SEL swizzledSel_);
 */
+ (void)hac_swizzleClassMethodWithClass:(Class)cls_ originalMethod:(SEL)origSel_ swizzledMethod:(SEL)swizzledSel_;

/**
 等价 NSString * hac_getClass(NSString *prefix_, NSString *suffix_);
 */
+ (Class)hac_getClassWithPrefix:(NSString *)prefix_ suffix:(NSString *)suffix_;

@end

NS_ASSUME_NONNULL_END
